package com.whfc.common.enums;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @Description: 设备类型枚举
 * @author: xugcheng
 * @version: 1.0
 * @date: 2019/7/22 11:47
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum DeviceType {

    mach(1, "机械设备"),

    helmet(2, "安全帽"),

    gps(3, "gps定位器"),

    water(4, "水质检测"),

    dust(5, "扬尘监测"),

    crane(6, "塔吊监控"),

    lift(7, "升降机监控"),

    equip(8, "考勤设备"),

    ivc(9, "车载摄像头"),

    videoHelmet(10, "视频安全帽"),

    obd(11, "OBD设备"),

    gas(12, "气体检测"),

    waterMeter(13, "智能水表"),

    electricMeter(14, "智能电表"),

    electricBox(15, "智能电箱"),

    gantry(16, "龙门吊"),

    bridge(17, "架桥机"),

    crawler(18, "履带吊"),

    settlement(19, "沉降位移"),

    jk(20, "基坑"),

    gzm(21, "高支模"),

    cloudm(22,"云机械云盒"),

    carWash(23,"车辆冲洗"),

    fenceEdge(24,"临边防护"),

    weatherWatches(25,"气象监测"),

    slopeMonitoring(26,"边坡监测"),
    ;

    private Integer value;

    private String desc;

    DeviceType(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer value() {
        return value;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static DeviceType parseByValue(Integer value) {
        DeviceType[] deviceTypes = DeviceType.values();
        for (DeviceType deviceType : deviceTypes) {
            if (deviceType.getValue().equals(value)) {
                return deviceType;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        for (int i = 0; i <= DeviceType.values().length; i++) {
            System.out.println(DeviceType.parseByValue(i));
        }
    }
}
